# Maintainer:  Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=perl-mail-dkim
_pkgname=Mail-DKIM
pkgver=1.20200724
pkgrel=0
pkgdesc="Signs/verifies Internet mail with DKIM/DomainKey signatures"
url="https://metacpan.org/pod/Mail::DKIM"
arch="noarch"
license="Artistic-Perl-1.0 GPL+"
depends="perl perl-net-dns perl-net-ip perl-mailtools perl-crypt-openssl-rsa
	perl-yaml-libyaml perl-net-dns-resolver-mock
	perl-mail-authenticationresults
	"
makedepends="perl-dev"
checkdepends="perl-test-requiresinternet"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/M/MB/MBRADSHAW/Mail-DKIM-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

prepare() {
	cd "$builddir"
	export CFLAGS=`perl -MConfig -E 'say $Config{ccflags}'`
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
}

build() {
	cd "$builddir"
	export CFLAGS=`perl -MConfig -E 'say $Config{ccflags}'`
	make
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

check() {
	cd "$builddir"
	make test
}

sha512sums="4d6f96ada894f3f1886b7d7e20c10a415ed04878847dd0dde752f9da532a76d95a81b3debbf5104459347f3081e655ffb56bc16392cf729f988e499b7d1e21ad  Mail-DKIM-1.20200724.tar.gz"
